#include <iostream>
#include "DynamicArray.h"

void PrintInt(void *ptr)
{
    std::cout<<(long)ptr<<" ";
}

bool CompairInt(void *ptr1,void *ptr2)
{
    long a1 = (long)ptr1;
    long a2 = (long)ptr2;
    if(a1 == a2)
        return true;
    return false;
}

int main()
{
    DynamicArray a(NULL);
    for(long i = 1; i <= 10; i++)
    {
        a.InsertTail((void*)i);
    }
    a.InsertTail((void*)2);
    a.RemoveByIndex(2);
    a.RemoveByElement((void*)2,CompairInt,NULL);
    DynamicArray ret = a.FindElement((void*)6,CompairInt);
    ret.show(PrintInt);
    a.show(PrintInt);
    return 0;
}